package com.javaAdmin.controller;

import com.javaAdmin.config.Wechat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Administrator
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Value("${wechat.appid}")
    private String appid;

    @Resource
    private Wechat wechat;

    @GetMapping("/hello")
    public String hello() {
        System.out.println(appid);
        return "hello";
    }

    @GetMapping("/wechat")
    public Wechat getWechat() {
        return wechat;
    }
}
